//
// Created by alexa on 5/16/2024.
//
#include "KeydownHandler.h"

void keydownHandle(Keys::Key (*getKeyFunc)(), const unordered_map<Keys::Key, function<void()>>& map) {
    do {
        Keys::Key pressedKey = getKeyFunc();
        if (!map.contains(pressedKey)) continue;
        return map.at(pressedKey)();
    } while (1);
}